package io.renren.modules.xsl.utils;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * 薪事力XML转换测试类
 */
public class XslXmlTest {
    
    public static void main(String[] args) {
        // 直接使用您提供的JSONArray数据进行测试
        String jsonData = "[{\"customFields\":{},\"orderNum\":\"0\",\"deptRoles\":{\"depLeader\":[],\"depLeader4charge\":[],\"depMgr\":[]},\"parentId\":\"5628262272371569605\",\"orgId\":\"5628262272371569605\",\"typeFlag\":\"group2\",\"modifyTime\":\"2025-11-07 10:02:33\",\"isDeleted\":false,\"createTime\":\"2025-11-04 17:42:17\",\"name\":\"湖南医药发展投资集团\",\"id\":\"5628262272371569605\",\"state\":0,\"isVirtual\":0},{\"customFields\":{\"platform_FwJJW1ur\":\"CN-中国\",\"platform_ZaNOO5mM\":\"1-大型\",\"platform_KIDv1H8O\":\"4-非上市\",\"platform_sEu60KCl\":\"湖南医药集团\",\"platform_HSu3FWmi\":\"91430000MABYUH0Q04\",\"platform_I9b6hyi9\":\"91430000MABYUH0Q04\",\"platform_tgzUSgTV\":\"1-一级\",\"platform_JHz6gK5L\":\"160-湖南省\",\"platform_d3IX6EVI\":\"430100-长沙市\",\"platform_C6vrL5oL\":\"27-医药制造业\",\"platform_BReew6oM\":\"1\"},\"orderNum\":\"001\",\"description\":\"\",\"deptRoles\":{\"depLeader\":[],\"depLeader4charge\":[],\"depMgr\":[]},\"parentId\":\"5628262272371569605\",\"orgId\":\"5628262272371569605\",\"typeFlag\":\"company\",\"modifyTime\":\"2025-11-20 16:33:58\",\"isDeleted\":false,\"createTime\":\"2025-11-12 11:00:24\",\"orgCode\":\"0151000000011\",\"name\":\"湖南医药发展集团总部\",\"id\":\"8044219211919328570\",\"state\":0,\"isVirtual\":0},{\"customFields\":{\"platform_FwJJW1ur\":\"CN-中国\",\"platform_ZaNOO5mM\":\"4-微型\",\"platform_KIDv1H8O\":\"4-非上市\",\"platform_sEu60KCl\":\"医研院\",\"platform_HSu3FWmi\":\"91430103MADH5XRY39\",\"platform_I9b6hyi9\":\"91430000MABYUH0Q04\",\"platform_tgzUSgTV\":\"3-二级\",\"platform_JHz6gK5L\":\"160-湖南省\",\"platform_d3IX6EVI\":\"430100-长沙市\",\"platform_C6vrL5oL\":\"75-科技推广和应用服务业\",\"platform_BReew6oM\":\"2\"},\"orderNum\":\"002\",\"deptRoles\":{\"depLeader\":[],\"depLeader4charge\":[],\"depMgr\":[]},\"parentId\":\"5628262272371569605\",\"orgId\":\"5628262272371569605\",\"typeFlag\":\"company\",\"modifyTime\":\"2025-11-20 16:33:58\",\"isDeleted\":false,\"createTime\":\"2025-11-12 14:08:08\",\"orgCode\":\"015100000002\",\"name\":\"湖南省医工融合创新研究院有限公司\",\"id\":\"5158404687065173966\",\"state\":0,\"isVirtual\":0},{\"customFields\":{\"platform_FwJJW1ur\":\"CN-中国\",\"platform_ZaNOO5mM\":\"3-小型\",\"platform_KIDv1H8O\":\"4-非上市\",\"platform_sEu60KCl\":\"基金公司\",\"platform_HSu3FWmi\":\"914300003384545792\",\"platform_I9b6hyi9\":\"91430000MABYUH0Q04\",\"platform_tgzUSgTV\":\"3-二级\",\"platform_JHz6gK5L\":\"160-湖南省\",\"platform_d3IX6EVI\":\"430100-长沙市\",\"platform_C6vrL5oL\":\"69-其他金融业\",\"platform_BReew6oM\":\"3\"},\"orderNum\":\"003\",\"deptRoles\":{\"depLeader\":[],\"depLeader4charge\":[],\"depMgr\":[]},\"parentId\":\"5628262272371569605\",\"orgId\":\"5628262272371569605\",\"typeFlag\":\"company\",\"modifyTime\":\"2025-11-20 16:33:58\",\"isDeleted\":false,\"createTime\":\"2025-11-12 14:29:51\",\"orgCode\":\"015100000003\",\"name\":\"湖南医药发展私募基金管理有限公司\",\"id\":\"7943591548865046648\",\"state\":0,\"isVirtual\":0},{\"customFields\":{\"platform_FwJJW1ur\":\"CN-中国\",\"platform_ZaNOO5mM\":\"3-小型\",\"platform_KIDv1H8O\":\"4-非上市\",\"platform_sEu60KCl\":\"天劲制药\",\"platform_HSu3FWmi\":\"91430100183802152J\",\"platform_I9b6hyi9\":\"91430000MABYUH0Q04\",\"platform_tgzUSgTV\":\"4-二级本部\",\"platform_JHz6gK5L\":\"160-湖南省\",\"platform_d3IX6EVI\":\"430100-长沙市\",\"platform_C6vrL5oL\":\"27-医药制造业\",\"platform_BReew6oM\":\"4\"},\"orderNum\":\"004\",\"deptRoles\":{\"depLeader\":[],\"depLeader4charge\":[],\"depMgr\":[]},\"parentId\":\"5628262272371569605\",\"orgId\":\"5628262272371569605\",\"typeFlag\":\"company\",\"modifyTime\":\"2025-11-20 16:33:58\",\"isDeleted\":false,\"createTime\":\"2025-11-12 16:13:51\",\"orgCode\":\"015100000004\",\"name\":\"湖南天劲制药有限责任公司\",\"id\":\"7739137931430242592\",\"state\":0,\"isVirtual\":0}]";
        
        // 解析JSON数据
        JSONArray testArray = JSONArray.parseArray(jsonData);
        
        // 输出原始JSON数据
        System.out.println("原始JSON数据：");
        System.out.println(testArray.toJSONString());
        
        // 转换为XML格式
        System.out.println("\n转换后的XML数据：");
        String xmlResult = XslXmlConverter.convertOrganizationToXml(testArray);
        System.out.println(xmlResult);
    }
}